tools/livepatch: Remove pointless retry loop
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 14 Dec 2016 07:51:57 +0000 (07:51 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 14 Dec 2016 20:27:19 +0000 (15:27 -0500)
commit4c8eab5a9349d0e1c654d38a1fd3d0d9643ab351
tree1627fe45abb728fd74177d99af17021e2975e917
parent3bc5cf73d72a743ec37567ca9203be5c0a28a5d5
tools/livepatch: Remove pointless retry loop

The default timeout in the hypervisor for a livepatch operation is 30 ms,
but xen-livepatch currently waits for up to 30 seconds for the operation
to complete. Instead, remove the retry loop and simply wait for 2 * 30 ms
for the operation to complete. The extra period is to account for the
time to actually start the operation.

Furthermore, have xen-livepatch set the hypervisor timeout rather than
relying on the hypervisor default since the tool doesn't know how long
it will be. Use nanosleep rather than usleep since usleep has been
removed from POSIX.1-2008.

Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
tools/misc/xen-livepatch.c